package com.kaibes.module.log;

import java.math.BigInteger;
import java.time.LocalDateTime;

import com.kaibes.core.base.annotation.Description;

import lombok.Data;
/**
CREATE TABLE `api_log` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `ip` varchar(15) DEFAULT NULL,
  `user_id` integer DEFAULT NULL,
  `url` varchar(128) NOT NULL,
  `method` varchar(8) NOT NULL,
  `request` mediumtext,
  `response` text,
  `request_header` text NOT NULL,
  `response_header` text NOT NULL,
  `status_code` smallint NOT NULL,
  `request_time` datetime NOT NULL,
  `response_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 */
@Description("API日志")
@Data
public class ApiLog {

    @Description("日志ID")
    private BigInteger id;
    @Description("客户端IP")
    private String ip;
    @Description("请求URL")
    private String url;
    @Description("请求方法")
    private String method;
    @Description("请求头")
    private String requestHeader;
    @Description("回复头")
    private String responseHeader;
    @Description("请求数据")
    private String request;
    @Description("回复数据")
    private String response;
    @Description("回复状态码")
    private int statusCode;
    @Description("用户ID")
    private Integer userId;
    @Description("请求时间")
    private LocalDateTime requestTime;
    @Description("返回时间")
    private LocalDateTime responseTime;
    
}
